﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using CLibArtreve.bll;
using CLibArtreve.security;

namespace WebAppArtreve.views.shared.components.arts
{
    public partial class WUCSpotlightedArt : System.Web.UI.UserControl
    {
        private string _connectionString
        {
            get
            {
                return ConfigurationManager.ConnectionStrings["ARTREVEConnectionString"].ConnectionString;
            }
        }
        private Int64? _userId
        {
            get
            {
                ArtreveIdentity identity = (ArtreveIdentity)Context.User.Identity;
                return identity.User.Id;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        //DATAPAGER NAVIGATION IN SPOTLIGHTED ART
        protected void CurrentRowTextBox_OnTextChanged(object sender,
    EventArgs e)
        {
            TextBox t = (TextBox)sender;
            DataPager pager =
                (DataPager)ListViewSpotlightedArts.FindControl("ArtsSpotlighedDataPager");
            pager.SetPageProperties(Convert.ToInt32(t.Text) - 1,
                 pager.PageSize, true);
        }

        protected void ListViewSpotlightedArts_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            
        }

        protected void ODSArtsALLSpotlighted_OnObjectCreating(object sender, ObjectDataSourceEventArgs e)
        {
            //STEP 2. CREATE BLL
            ArtBLL ObjectInstance = new ArtBLL(_connectionString);
            //STEP 3. CONNECT TYPENAME
            e.ObjectInstance = ObjectInstance;
        }

    }
}